import {ref,computed} from 'vue';
import {defineStore} from "pinia";
import {getEventsApi,getEventDetailApi} from "@/api/event";
export const useEventStore = defineStore("event", ()=>{
    const events = ref([])
    const event = ref({})
    const getEvents = async ()=>{
        const response = await getEventsApi()
        events.value = response.data
    }
    const getEventDetail = async (id)=>{
        const response = await getEventDetailApi(id)
        event.value = response.data
    }
    return {
        events,
        event,
        getEvents,
        getEventDetail
    }

})